﻿using System.Threading.Tasks;
using Jinjia.Approve.Entity.Entity;
using Jinjia.Approve.IRepository;
using Jinjia.Core.UnitOfWork.UnitOfWorkComponent;
using SqlSugar;

namespace Jinjia.Approve.Repository
{
    public class ErpaManualTradeRepository : IErpaManualTradeRepository
    {
        private readonly ISqlSugarClient _db;

        public ErpaManualTradeRepository(IUnitOfWork unitOfWork)
        {
            _db = unitOfWork.GetDbClient();
        }
        
        public async Task<erpa_manual_trade_tbl> GetById(int id)
        {
            var erpaManualTradeTbl = await _db.Queryable<erpa_manual_trade_tbl>().Where(x => x.id == id).FirstAsync();
            return erpaManualTradeTbl;
        }
    }
}